|
Repetier-Firmware
1.0.0
|
#include <motion.h>
Static Public Member Functions | |
| static void | resetPathPlanner () |
| static INLINE bool | hasLines () |
| static INLINE void | setCurrentLine () |
| static INLINE void | removeCurrentLineForbidInterrupt () |
| static INLINE void | pushLine () |
| static uint8_t | getLinesCount () |
| static PrintLine * | getNextWriteLine () |
| static void | computeMaxJunctionSpeed (PrintLine *previous, PrintLine *current) |
| static int32_t | bresenhamStep () |
| static void | waitForXFreeLines (uint8_t b=1, bool allowMoves=false) |
| static void | forwardPlanner (ufast8_t p) |
| static void | backwardPlanner (ufast8_t p, ufast8_t last) |
| static void | updateTrapezoids () |
| static uint8_t | insertWaitMovesIfNeeded (uint8_t pathOptimize, uint8_t waitExtraLines) |
| static void | LaserWarmUp (uint32_t wait) |
| static void | queueCartesianMove (uint8_t check_endstops, uint8_t pathOptimize) |
| static void | queueCartesianSegmentTo (uint8_t check_endstops, uint8_t pathOptimize) |
| static void | moveRelativeDistanceInSteps (int32_t x, int32_t y, int32_t z, int32_t e, float feedrate, bool waitEnd, bool check_endstop, bool pathOptimize=true) |
| static void | moveRelativeDistanceInStepsReal (int32_t x, int32_t y, int32_t z, int32_t e, float feedrate, bool waitEnd, bool pathOptimize=true) |
| static void | arc (float *position, float *target, float *offset, float radius, uint8_t isclockwise) |
| static INLINE void | previousPlannerIndex (ufast8_t &p) |
| static INLINE void | nextPlannerIndex (ufast8_t &p) |
| static uint8_t | queueNonlinearMove (uint8_t check_endstops, uint8_t pathOptimize, uint8_t softEndstop) |
| static void | queueEMove (int32_t e_diff, uint8_t check_endstops, uint8_t pathOptimize) |
| static void | calculateDirectionAndDelta (int32_t difference[], ufast8_t *dir, int32_t delta[]) |
| static uint8_t | calculateDistance (float axis_diff[], uint8_t dir, float *distance) |
| static void | calculatePlane (int32_t factors[], int32_t p1[], int32_t p2[], int32_t p3[]) |
| static float | calcZOffset (int32_t factors[], int32_t pointX, int32_t pointY) |
Public Attributes | |
| ufast8_t | joinFlags |
| volatile ufast8_t | flags |
| secondspeed_t | secondSpeed |
| int32_t | stepsRemaining |
| Remaining steps, until move is finished. More... | |
Static Public Attributes | |
| static ufast8_t | linesPos = 0 |
| Position for executing line movement. More... | |
| static PrintLine | lines [] |
| Cache for print moves. More... | |
| static ufast8_t | linesWritePos = 0 |
| Position where we write the next cached line move. More... | |
| static PrintLine * | cur = NULL |
| Current printing line. More... | |
| static volatile ufast8_t | linesCount = 0 |
| Number of lines cached 0 = nothing to do. More... | |
Private Attributes | |
| fast8_t | primaryAxis |
| ufast8_t | dir |
| Direction of movement. 1 = X+, 2 = Y+, 4= Z+, values can be combined. More... | |
| int32_t | timeInTicks |
| int32_t | delta [E_AXIS_ARRAY] |
| Steps we want to move. More... | |
| int32_t | error [E_AXIS_ARRAY] |
| Error calculation for Bresenham algorithm. More... | |
| float | speedX |
| Speed in x direction at fullInterval in mm/s. More... | |
| float | speedY |
| Speed in y direction at fullInterval in mm/s. More... | |
| float | speedZ |
| Speed in z direction at fullInterval in mm/s. More... | |
| float | speedE |
| Speed in E direction at fullInterval in mm/s. More... | |
| float | fullSpeed |
| Desired speed mm/s. More... | |
| float | invFullSpeed |
| 1.0/fullSpeed for faster computation More... | |
| float | accelerationDistance2 |
| Real 2.0*distance*acceleration mm²/s² More... | |
| float | maxJunctionSpeed |
| Max. junction speed between this and next segment. More... | |
| float | startSpeed |
| Starting speed in mm/s. More... | |
| float | endSpeed |
| Exit speed in mm/s. More... | |
| float | minSpeed |
| float | distance |
| uint8_t | numNonlinearSegments |
| Number of delta segments left in line. Decremented by stepper timer. More... | |
| uint8_t | moveID |
| ID used to identify moves which are all part of the same line. More... | |
| int32_t | numPrimaryStepPerSegment |
| Number of primary Bresenham axis steps in each delta segment. More... | |
| NonlinearSegment | segments [DELTASEGMENTS_PER_PRINTLINE] |
| ticks_t | fullInterval |
| interval at full speed in ticks/step. More... | |
| uint32_t | accelSteps |
| How much steps does it take, to reach the plateau. More... | |
| uint32_t | decelSteps |
| How much steps does it take, to reach the end speed. More... | |
| uint32_t | accelerationPrim |
| Acceleration along primary axis. More... | |
| uint32_t | fAcceleration |
| accelerationPrim*262144/F_CPU More... | |
| speed_t | vMax |
| Maximum reached speed in steps/s. More... | |
| speed_t | vStart |
| Starting speed in steps/s. More... | |
| speed_t | vEnd |
| End speed in steps/s. More... | |
Static Private Attributes | |
| static volatile bool | nlFlag |
Friends | |
| class | UIDisplay |
|
static |
|
inline |
Compute the maximum speed from the last entered move. The backwards planner traverses the moves from last to first looking at deceleration. The RHS of the accelerate/decelerate ramp.
start = last line inserted last = last element until we check
|
inline |
|
static |
|
inlinestatic |
|
inlinestatic |
| void PrintLine::calculateMove | ( | float | axis_diff[], |
| uint8_t | pathOptimize, | ||
| fast8_t | distanceBase | ||
| ) |
|
inline |
|
static |
|
static |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inlinestatic |
|
static |
Check if move is new. If it is insert some dummy moves to allow the path optimizer to work since it does not act on the first two moves in the queue. The stepper timer will spot these moves and leave some time for processing.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
| void PrintLine::logLine | ( | ) |
|
inline |
|
inline |
|
static |
Move printer the given number of steps. Puts the move into the queue. Used by e.g. homing commands. Does not consider rotation but updates position correctly considering rotation. This can be used to correct positions when changing tools.
| x | Distance in x direction in steps |
| y | Distance in y direction in steps |
| z | Distance in z direction in steps |
| e | Distance in e direction in steps |
| feedrate | Feed rate to be used in mm/s. Gets new active feedrate. |
| waitEnd | If true will block until move is finished. |
| checkEndstop | True if triggering endstop should stop move. |
| pathOptimize | If false start and end speeds get fixed to minimum values. |
|
static |
Adds the steps converted to mm to the lastCmdPos position and moves to that position using Printer::moveToReal. Will use Printer::isPositionAllowed to prevent illegal moves.
| x | Distance in x direction in steps |
| y | Distance in y direction in steps |
| z | Distance in z direction in steps |
| e | Distance in e direction in steps |
| feedrate | Feed rate to be used in mm/s. Gets new active feedrate. |
| waitEnd | If true will block until move is finished. |
| pathOptimize | If false start and end speeds get fixed to minimum values. |
|
inlinestatic |
|
static |
Put a move to the current destination coordinates into the movement cache. If the cache is full, the method will wait, until a place gets free. During wait communication and temperature control is enabled.
destinationSteps must be excluding any z correction! We will add that if required here.
| check_endstops | Read end stop during move. |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void PrintLine::updateStepsParameter | ( | ) |
Update parameter used by updateTrapezoids
Computes the acceleration/deceleration steps and advanced parameter associated.
|
static |
This is the path planner.
It goes from the last entry and tries to increase the end speed of previous moves in a fashion that the maximum jerk is never exceeded. If a segment with reached maximum speed is met, the planner stops. Everything left from this is already optimal from previous updates. The first 2 entries in the queue are not checked. The first is the one that is already in print and the following will likely to become active.
The method is called before lines_count is increased!
|
static |
|
friend |
|
private |
Real 2.0*distance*acceleration mm²/s²
|
private |
Acceleration along primary axis.
|
private |
How much steps does it take, to reach the plateau.
|
static |
Current printing line.
|
private |
How much steps does it take, to reach the end speed.
|
private |
Steps we want to move.
|
private |
Direction of movement. 1 = X+, 2 = Y+, 4= Z+, values can be combined.
|
private |
|
private |
Exit speed in mm/s.
|
private |
Error calculation for Bresenham algorithm.
|
private |
accelerationPrim*262144/F_CPU
| volatile ufast8_t PrintLine::flags |
|
private |
interval at full speed in ticks/step.
|
private |
Desired speed mm/s.
|
private |
1.0/fullSpeed for faster computation
| ufast8_t PrintLine::joinFlags |
|
static |
Cache for print moves.
|
static |
Number of lines cached 0 = nothing to do.
|
static |
Position for executing line movement.
|
static |
Position where we write the next cached line move.
|
private |
Max. junction speed between this and next segment.
|
private |
|
private |
ID used to identify moves which are all part of the same line.
|
staticprivate |
|
private |
Number of delta segments left in line. Decremented by stepper timer.
|
private |
Number of primary Bresenham axis steps in each delta segment.
|
private |
| secondspeed_t PrintLine::secondSpeed |
|
private |
|
private |
Speed in E direction at fullInterval in mm/s.
|
private |
Speed in x direction at fullInterval in mm/s.
|
private |
Speed in y direction at fullInterval in mm/s.
|
private |
Speed in z direction at fullInterval in mm/s.
|
private |
Starting speed in mm/s.
| int32_t PrintLine::stepsRemaining |
Remaining steps, until move is finished.
|
private |
|
private |
End speed in steps/s.
|
private |
Maximum reached speed in steps/s.
|
private |
Starting speed in steps/s.